package com.naiterui.ehp.bp.constants;

/**
 * <pre>
 *      医患关系
 * </pre>
 *
 * @author 王泽浩
 * @date 2018/6/30 下午5:59
 * @since 1.0.0
 */
@SuppressWarnings("unused")
public class DoctorPatientRelation {

    /**
     * 医患关系状态：正常
     */
    public static final int RELATION_FLAG_NORMALITY = 0;
    /**
     * 医患关系状态：删除
     */
    public static final int RELATION_FLAG_DELETE = 1;
    private static final String DOCTOR_PATIENT_RELATION_KEY = CommonConstant.REDIS_PRE_DR + "doctor_patient_relation_%s_%s";

    private DoctorPatientRelation() {
    }

    /**
     * 获取医患关系redis key
     *
     * @param doctorId  医生id
     * @param patientId 患者id
     *
     * @return 医患redis key
     */
    public static String getRedisKey(Long doctorId, Long patientId) {
        if (doctorId == null || patientId == null) {
            throw new IllegalStateException("获取删除医患关系key失败，医生患者ID不能为null");
        }
        return String.format(DOCTOR_PATIENT_RELATION_KEY, doctorId, patientId);
    }

}
